package com.gzsxy.bridge;

/**
 * @author xiaolong
 * @version 1.0
 * @description: 抽象的电脑类型
 * @date 2022/4/23 14:50
 */
public abstract  class Computer {
    //组合，品牌~ 桥
    protected Brand brand;

    public Computer(Brand brand) {
        this.brand = brand;
    }

    public void info(){
        brand.info();
        //自带品牌

    }
}

//台式机
class Desktop extends Computer{


    public Desktop(Brand brand) {
        super(brand);
    }

    @Override
    public void info() {
        super.info();
        System.out.println("台式机");
    }
}

//笔记本
class Laptop extends Computer{


    public Laptop(Brand brand) {
        super(brand);
    }

    @Override
    public void info() {
        super.info();
        System.out.println("笔记本");
    }
}